package o;

import androidx.annotation.Nullable;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.Renderer;
import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
import com.google.android.exoplayer2.drm.DrmInitData;
import java.io.IOException;

public abstract class aay implements Renderer, abm {
    private Format[] ʻ;
    private boolean ʼ = true;
    private long ʽ;
    private aiu ˊ;
    private int ˋ;
    private abs ˎ;
    private final int ˏ;
    private int ॱ;
    private boolean ᐝ;

    public aay(int i) {
        this.ˏ = i;
    }

    public final int f_() {
        return this.ˏ;
    }

    public final abm ˎ() {
        return this;
    }

    public final void ˊ(int i) {
        this.ॱ = i;
    }

    public ana ˋ() {
        return null;
    }

    public final int ˊ() {
        return this.ˋ;
    }

    public final void ॱ(abs o_abs, Format[] formatArr, aiu o_aiu, long j, boolean z, long j2) throws ExoPlaybackException {
        amm.ˏ(this.ˋ == 0);
        this.ˎ = o_abs;
        this.ˋ = 1;
        ˏ(z);
        ˋ(formatArr, o_aiu, j2);
        ˏ(j, z);
    }

    public final void ˏ() throws ExoPlaybackException {
        boolean z = true;
        if (this.ˋ != 1) {
            z = false;
        }
        amm.ˏ(z);
        this.ˋ = 2;
        ॱˊ();
    }

    public final void ˋ(Format[] formatArr, aiu o_aiu, long j) throws ExoPlaybackException {
        amm.ˏ(!this.ᐝ);
        this.ˊ = o_aiu;
        this.ʼ = false;
        this.ʻ = formatArr;
        this.ʽ = j;
        ˏ(formatArr, j);
    }

    public final aiu ʼ() {
        return this.ˊ;
    }

    public final boolean ᐝ() {
        return this.ʼ;
    }

    public final void ʽ() {
        this.ᐝ = true;
    }

    public final boolean ʻ() {
        return this.ᐝ;
    }

    public final void ॱॱ() throws IOException {
        this.ˊ.ˊ();
    }

    public final void ˋ(long j) throws ExoPlaybackException {
        this.ᐝ = false;
        this.ʼ = false;
        ˏ(j, false);
    }

    public final void ˋॱ() throws ExoPlaybackException {
        amm.ˏ(this.ˋ == 2);
        this.ˋ = 1;
        ͺ();
    }

    public final void ˊॱ() {
        boolean z = true;
        if (this.ˋ != 1) {
            z = false;
        }
        amm.ˏ(z);
        this.ˋ = 0;
        this.ˊ = null;
        this.ʻ = null;
        this.ᐝ = false;
        ॱˎ();
    }

    public int ˏॱ() throws ExoPlaybackException {
        return 0;
    }

    public void ˎ(int i, @Nullable Object obj) throws ExoPlaybackException {
    }

    protected void ˏ(boolean z) throws ExoPlaybackException {
    }

    protected void ˏ(Format[] formatArr, long j) throws ExoPlaybackException {
    }

    protected void ˏ(long j, boolean z) throws ExoPlaybackException {
    }

    protected void ॱˊ() throws ExoPlaybackException {
    }

    protected void ͺ() throws ExoPlaybackException {
    }

    protected void ॱˎ() {
    }

    protected final Format[] ʻॱ() {
        return this.ʻ;
    }

    protected final abs ॱˋ() {
        return this.ˎ;
    }

    protected final int ॱᐝ() {
        return this.ॱ;
    }

    protected final int ˊ(abk o_abk, DecoderInputBuffer decoderInputBuffer, boolean z) {
        int ˊ = this.ˊ.ˊ(o_abk, decoderInputBuffer, z);
        if (ˊ == -4) {
            if (decoderInputBuffer.ˏ()) {
                this.ʼ = true;
                if (this.ᐝ) {
                    return -4;
                }
                return -3;
            }
            decoderInputBuffer.ˏ += this.ʽ;
        } else if (ˊ == -5) {
            Format format = o_abk.ॱ;
            if (format.ˊॱ != Long.MAX_VALUE) {
                o_abk.ॱ = format.ॱ(format.ˊॱ + this.ʽ);
            }
        }
        return ˊ;
    }

    protected int ˎ(long j) {
        return this.ˊ.ˊ(j - this.ʽ);
    }

    protected final boolean ᐝॱ() {
        return this.ʼ ? this.ᐝ : this.ˊ.ॱ();
    }

    protected static boolean ˎ(@Nullable adf<?> o_adf_, @Nullable DrmInitData drmInitData) {
        if (drmInitData == null) {
            return true;
        }
        if (o_adf_ == null) {
            return false;
        }
        return o_adf_.ॱ(drmInitData);
    }

    public void ॱ(float f) throws ExoPlaybackException {
    }
}
